package com.competition.web.admin.util;

/**
 * 
 * @author 111
 */
public class GetTheZeroTimeStampOfTheDay {

	/**
	 */
	public static long ONE_DAY_TIME_MILLIS = 60 * 60 * 24 * 1000L;

	/**
	 */
	private static long EIGHT_HOUR_MILLIS = 60 * 60 * 8 * 1000L;

	/**
	 * 
	 * @return
	 */
	public static long getCurrentZero() {
		long currentTimeMillis = System.currentTimeMillis();
		long temp = currentTimeMillis + EIGHT_HOUR_MILLIS;

		return ((temp - temp % ONE_DAY_TIME_MILLIS) - EIGHT_HOUR_MILLIS);
	}

	/**
	 * 
	 * @return
	 */
	public static long getYesterdayZero() {
		return getCurrentZero() - ONE_DAY_TIME_MILLIS;
	}

	/**
	 * @return
	 */
	public static long getEndTimeOfTheDay() {

		return getCurrentZero() + ONE_DAY_TIME_MILLIS - 1;
	}
}
